package com.kedacom.freedomLabel.initdata.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;

import com.kedacom.freedomLabel.initdata.bean.MachineNumber;
import com.kedacom.freedomLabel.initdata.bean.Post;
import com.kedacom.freedomLabel.model.db.dao.IDao;

import java.util.List;


/**
 * Created by yao on 2021/3/23.
 * Describe
 */
@Dao
public interface MachineNumDao extends IDao<MachineNumber> {


    @Override
    @Query("SELECT COUNT(0) FROM MachineNumber")
    int count();

    @Override
    @Update
    void update(MachineNumber data);

    @Override
    @Insert(onConflict = OnConflictStrategy.FAIL)
    long save(MachineNumber data);

    @Override
    @Insert(onConflict = OnConflictStrategy.FAIL)
    long[] save(List<MachineNumber> data);

    @Override
    @Query("SELECT * FROM MachineNumber")
    List<MachineNumber> get();

    @Override
    @Query("SELECT * FROM MachineNumber WHERE machineName=:param")
    List<MachineNumber> get(String param);

    @Override
    @Query("SELECT * FROM MachineNumber WHERE machineName=:param1 and machineName LIKE :param2")
    List<MachineNumber> get(String param1, String param2);

    @Override
    @Delete
    void delete(MachineNumber data);

    @Override
    @Query("DELETE FROM MachineNumber")
    void delete();

    @Override
    @Query("DELETE FROM MachineNumber WHERE machineName=:param ")
    void delete(String param);



//    @Query("SELECT * FROM MachineNumber")
//    List<MachineNumber> getAllMachine();
//
//    @Query("SELECT * FROM MachineNumber WHERE machineName=:machineName")
//    MachineNumber getMachineOne(String machineName);
//
//    @Insert
//    void insert(MachineNumber machineNumber);
//
//    @Query("DELETE FROM MachineNumber WHERE MachineNumber.machineName=:machineName")
//    void deleteOne(String machineName);
//
//    @Delete
//    void deleteAll(List<MachineNumber> machineNumber);


//    @Delete
//    void delete(MachineNumber... machineNumber);
}
